home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_actor_kid.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  81 lines

  1. # Jones 3D Cog Script
  2. #
  3. # actor_Kid.cog
  4. #
  5. # [RT]
  6. #
  7. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ===================================================================
  10.  
  11. symbols
  12.  
  13.     message        created
  14.     message        damaged
  15.  
  16.     model        head0=head_by_asound.3do    local
  17.     model        head1=head_by_amsound.3do    local
  18.     model        head2=head_by_osound.3do    local
  19.  
  20.     sound        snd0=inxb001.wav            local    # "No shooting, please!"
  21.     sound        snd1=inxb002.wav            local    # "Don't shoot...it's me, not a hyena."
  22.     sound        snd2=inxb003.wav            local    # "Hey, that could hurt!"
  23.     sound        snd3=inxb004.wav            local    # "Stop, or I refuse to help you!"
  24.  
  25.     thing        kid                            local
  26.  
  27.     int            newLine                        local
  28.     int            lastLine=-1                    local
  29.  
  30.     int            bTalking=0                    local
  31.  
  32. end
  33.  
  34. # ===================================================================
  35.  
  36. code
  37.  
  38. created:
  39.  
  40.     kid = GetSenderRef();
  41.     SetThingVoiceHeads(kid, "byhead", "", "head_by_asound.3do", "head_by_amsound.3do", "head_by_osound.3do");
  42.     return;
  43.  
  44. # -------------------------------------------------------------------
  45.  
  46. damaged:
  47.  
  48.     if (GetThingParent(GetSourceRef()) != GetLocalPlayerThing()) return;
  49.  
  50.     if (bTalking) return;
  51.  
  52.     bTalking = 1;
  53.  
  54.     kid = GetSenderRef();
  55.  
  56.     # Impact damage
  57.     if (BitTest(GetParam(1), 0x1))
  58.     {
  59.         while (newLine == lastLine)
  60.         {
  61.             newLine = RandBetween(0, 3);
  62.         }
  63.     }
  64.     # Anything else
  65.     else
  66.     {
  67.         while (newLine == lastLine)
  68.         {
  69.             newLine = RandBetween(2, 3);
  70.         }
  71.     }
  72.  
  73.     # Start the voice & wait...
  74.     PlayVoice(kid, snd0[newLine], 1.0, 1);
  75.  
  76.     bTalking = 0;
  77.     lastLine = newLine;
  78.  
  79.     return;
  80.  
  81. end